import _Request from '@/config/service/request'
import type { InternalAxiosRequestConfig } from 'axios'
import { BASE_URL, TIME_OUT } from './config'

const spring = new _Request({
  baseURL: BASE_URL,
  timeout: TIME_OUT,
  interceptors: {
    // 请求拦截器
    requestInterceptors: (config) => {
      return config as InternalAxiosRequestConfig
    },
    // 响应拦截器
    responseInterceptors: (result) => {
      return result
    }
  }
})

export default spring
